

#CXX = icc
#CXXFLAGS =  -I../eigen/  -I../cmdioutil/include/ 
CXX = g++
CXXFLAGS =  -I../eigen/  -I../cmdioutil/include/  -std=c++0x -msse2 -DEIGEN_NO_DEBUG -O2 -DNDEBUG

LINK = $(CXX)
LINKFLAGS = -static

MPICXX = mpic++
MPICXXFLAGS = -I../eigen/ -DPARALLEL   -I../cmdioutil/include/  -std=c++0x -msse2 -DEIGEN_NO_DEBUG -O2 -DNDEBUG
MPILINK = $(MPICXX)
MPILINKFLAGS = 


test :  ./source/transportab_thesis.o  ./source/transportab.o ./source/shinfo.o ./source/posttr.o 
	$(LINK) $(LINKFLAGS) -O2 -o ./bin_test/transportab ./source/transportab.o 
#	$(LINK) $(LINKFLAGS) -O2 -o ./bin_test/transportab_thesis ./source/transportab_thesis.o 
	$(LINK) $(LINKFLAGS) -O2 -o ./bin_test/shinfo ./source/shinfo.o 
	$(LINK) $(LINKFLAGS) -O2 -o ./bin_test/posttr ./source/posttr.o 


serial :  ./source/transportab_thesis.o  ./source/transportab.o ./source/shinfo.o ./source/posttr.o 
	$(LINK) $(LINKFLAGS) -O2 -o ./bin/transportab ./source/transportab.o 
#	$(LINK) $(LINKFLAGS) -O2 -o ./bin/transportab_thesis ./source/transportab_thesis.o 
	$(LINK) $(LINKFLAGS) -O2 -o ./bin/shinfo ./source/shinfo.o 
	$(LINK) $(LINKFLAGS) -O2 -o ./bin/posttr ./source/posttr.o 
        
./source/transportab.o: ./source/transportab.cpp ./source/transportio.h ./source/hamiltonian.h
	$(CXX) $(CXXFLAGS) -O2 -c ./source/transportab.cpp -o ./source/transportab.o

#./source/transportab_thesis.o: ./source/transportab_thesis.cpp ./source/transportio.h ./source/hamiltonian.h
#	$(CXX) $(CXXFLAGS) -O2 -c ./source/transportab_thesis.cpp -o ./source/transportab_thesis.o
        
./source/shinfo.o: ./source/shinfo.cpp ./source/hamiltonian.h
	$(CXX) $(CXXFLAGS) -O2 -c ./source/shinfo.cpp -o ./source/shinfo.o

./source/posttr.o: ./source/posttr.cpp ./source/hamiltonian.h
	$(CXX) $(CXXFLAGS) -O2 -c ./source/posttr.cpp -o ./source/posttr.o

parallel :  ./source/transportabp.o  
	$(MPILINK) $(MPILINKFLAGS) -O2 -o ./bin/transportabp ./source/transportabp.o 

./source/transportabp.o: ./source/transportab.cpp ./source/transportio.h ./source/hamiltonian.h
	$(MPICXX) $(MPICXXFLAGS) -O2 -c ./source/transportab.cpp -o ./source/transportabp.o

.PHONY: clean

clean:
	rm ./source/*.o


#info about warnings: harmless : http://www-theor.ch.cam.ac.uk/IT/servers/clust/clust-parallel.html

 
